package com.bai.localshop.constant;

/**
 * Redis Key 常量类
 */
public class RedisKeyConstant {

    /**
     * 商品详情缓存 key 格式: product:{id}
     */
    public static final String PRODUCT_KEY = "product:%s";

    /**
     * 空值商品缓存 key 格式: null_product:{id} (防止缓存穿透)
     */
    public static final String NULL_PRODUCT_KEY = "null_product:%s";

    /**
     * 热门商品列表缓存 key
     */
    public static final String HOT_PRODUCT_LIST_KEY = "hot_product_list";

    /**
     * 商品更新分布式锁 key 格式: product_update:{id}
     */
    public static final String PRODUCT_UPDATE_LOCK_KEY = "product_update:%s";

    /**
     * 优惠券相关Redis Key
     */
    public static final String VOUCHER_KEY = "voucher:%s";
    public static final String NULL_VOUCHER_KEY = "null_voucher:%s";
    public static final String HOT_VOUCHER_LIST_KEY = "hot_voucher_list";
    public static final String VOUCHER_UPDATE_LOCK_KEY = "lock_voucher_update:%s";
}